package com.mini.config;

import cn.hutool.core.util.EnumUtil;
import com.mini.enums.YesOrNoEnum;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Data
@Component
public class SendConfig {


    private YesOrNoEnum saveSendRecords;

    @Value("${config.msg.save-send-records:N}")
    public void setSendRecords(String saveSendRecords) {
        this.saveSendRecords = EnumUtil.getBy(YesOrNoEnum::getCode, saveSendRecords);
    }

}
